package com.sky.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.mapper.SetmealDishMapper;
import com.sky.mapper.SetmealMapper;
import com.sky.service.SetmealDishService;
import com.sky.service.SetmealService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能:
 * 作者:Dksheep
 * 日期:2025/1/1715:18
 */
@Service
public class SetmealDishServiceImpl extends ServiceImpl<SetmealDishMapper, SetmealDish> implements SetmealDishService {
    public boolean saveBatchs(List<SetmealDish> setmealDishList) {
        // 假设每次批量操作的数量是100
        //final int batchSize = 100;
        // 使用saveBatch方法批量插入
        return this.saveBatch(setmealDishList);
    }

    @Override
    public void removeDishes(List<SetmealDish> setmealDishes) {
        this.removeBatchByIds(setmealDishes);
    }
}
